package com.zhang;

import com.zhang.dao.BookDao;
import com.zhang.service.BookService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class APP02 {
    public static void main(String[] args) {
//        //获取IOC容器
//        ApplicationContext ac = new ClassPathXmlApplicationContext("applicationContext.xml");
//        //获取bean id = "bookDao"
//        BookDao bookDao = (BookDao) ac.getBean("name1");
//
////        bookDao.sava();//book dao sava
//
//        //获取bean id= “bookService”
//        BookService bookService = (BookService) ac.getBean("bookService");
//
//        bookService.sava();//book service sava
//                          // book dao sava
//    }
    }
}
